﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Net.Http;
using System.Web.Http;

using MiniSched.Data;

namespace MiniSched.Web.Areas.Api {

    public abstract class MiniSchedApiController : ApiController {

        internal MiniSchedApiController() { }

        protected override void Dispose(bool disposing) {
            if (disposing) {
                if (_Context != null) {
                    _Context.Dispose();
                }
            }
            base.Dispose(disposing);
        }

        public MiniSchedContext Context {
            get { return _Context ?? (_Context = new MiniSchedContext()); }
            set { _Context = value; }
        }
        private MiniSchedContext _Context;
    }
}